import request from "@/utils/request";
// 查询我的申请
export function selectList(query) {
  return request({
    url: '/system/applys/list',
    method: 'get',
    params: query
  })
}
// 查询代办
// export function selectTaskList() {
//   return request({
//     url: '/system/applys/task',
//     method: 'get',
//   })
// }
export function selectTaskList() {
  return request({
    url: '/system/applys/listActivity',
    method: 'get',
  })
}
// 查询我的代办
export function selectHistoryList() {
  return request({
    url: '/system/applys/history',
    method: 'get',
  })
}
// 查询代办
export function selectComplete(data) {
  return request({
    url: '/system/applys/complete',
    method: 'post',
    data: data
  })
}
// 查询请假详细
export function getLeave(leaveId) {
  return request({
    url: '/system/applys/' + leaveId,
    method: 'get'
  })
}
//送审
// export function goApply(procId,proposer,days,flag) {
//   return request({
//     url: '/system/applys/goApply/'+procId+'/'+proposer+'/'+days+'/'+flag,
//     method: 'get'
//   })
// }
//送审
export function goApply(procId,proposer,days,flag) {
  const data = {
    procId,
    proposer,
    days,
    flag,
  }
  return request({
    url: '/system/applys/goApply',
    method: 'get',
    params: data
  })
}

// 新增请假
export function addLeave(data) {
  return request({
    url: '/system/applys',
    method: 'post',
    data: data
  })
}

// 修改请假
export function updateLeave(data) {
  return request({
    url: '/system/applys',
    method: 'put',
    data: data
  })
}


// 删除请假
export function delLeave(leaveId) {
  return request({
    url: '/system/applys/' + leaveId,
    method: 'delete'
  })
}
